﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="exchangeGoods.aspx.cs" Inherits="WebApp.admin.goods.exchangeGoods" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>商品列表</title>
    <link href="../css/skin.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript">


        function SelectGoodsGift() {
            var str = "";
            var goods = "";
            var m = 0;
            var r = document.getElementsByName("Item");
            if (r.length > 0) {
                for (var i = 0; i < r.length; i++) {
                    if (r[i].checked) {

                        if (m == 0) {
                            str = str + r[i].id;
                            goods = goods + r[i].value;
                        } else {
                            str = str + "," + r[i].id;
                            goods = goods +"," + r[i].value;
                        }

                        m++;
                    }
                }
            }
            if (str.length > 0) {

                window.opener.document.getElementById("hdEge").value = str;
                window.opener.document.getElementById("lblGoods").value = goods;
                window.close();
            }
        }

    
    </script>
</head>
<script type="text/javascript" src="../js/main.js"></script>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/jquery.js"></script>



<body class="body">
    <table class="main" cellpadding="0" cellspacing="0">

        <tr>
            <td class="td_middle_middle">
                <div class="maincontent">
                    <form id="formSearch" action="exchangeGoods.aspx">
                     
                        <label>
                            查找：</label>
                        <select id="selectGoods" name="t">
                            <option value="goodsName" selected="selected">商品名称</option>
                            <option value="goodsNo">商品编号</option>
                            <option value="categoryName">商品分类</option>
                        </select>
                        <input id="txtKeyWord" type="text" name="kw" value="<%=kw %>" />
                        <input id="btnSearch" type="submit" class="formButton" value="搜  索" />
                        &nbsp;&nbsp;

                        <label>
                            每页显示：</label>
                        <select id="selectPageSize" name="ps" onchange="SetPageSize();">
                            <option value="10">10</option>
                            <option value="20" selected="selected">20</option>
                            <option value="50">50</option>
                            <option value="100">100</option>
                        </select>
                    </form>
                    <form id="form1" runat="server">
                        <table cellpadding="0" cellspacing="0">
                            <tr class="tr_title">
                                <td>
                                  选择商品
                                </td>
                                <td>
                                    <span onclick="SetOrder('goodsName');">商品名称</span></td>
                                <td>
                                    <span onclick="SetOrder('goodsNo');">商品编号</span></td>
                                <td>
                                    <span onclick="SetOrder('category');">商品分类</span></td>
                                <td>
                                    <span onclick="SetOrder('salePrice');">销售价格</span></td>
                                <td>
                                    <span onclick="SetOrder('isShelves');">商城上架</span></td>       
                                <td>
                                    <span onclick="SetOrder('inventory');">库存数量</span></td>
                                <td>
                                    <span onclick="SetOrder('isFromFreight');">运费</span></td>
                            </tr>
                            <asp:Repeater ID="rptGoods" runat="server"  onitemdatabound="rptGoods_ItemDataBound" >
                                <ItemTemplate>
                                    <tbody>
                                        <tr>
                                            <td>
                                                <input id='<%# Eval("id") %>' name="Item" type="checkbox"   onclick="SelectGoodsGift();"
                                                    value='<%# Eval("goodsName") %>'   /></td>
                                            <td>
                                                <a href="goods.aspx?show=1&id=<%# Eval("id") %>" target="_blank" >
                                                    <%# Eval("goodsName")%>
                                                </a>
                                            </td>
                                            <td>
                                                <%# Eval("goodsNo") %>
                                            </td>
                                            <td>
                                                <%# GetCategoryName(Eval("category"))%>
                                            </td>
                                            <td>
                                                <%# Eval("salePrice")%>
                                            </td>
                                            <td>
                                                <%# Convert.ToInt32(Eval("isShelves"))==1?"是":"否"%>
                                             </td>
                                      
                                            <td>
                                                <%# Eval("inventory")%>
                                            </td>
                                            <td>
                                                <%# Convert.ToInt32(Eval("isFromFreight"))==0?"买家承担":"卖家承担" %>
                                            </td>
                                        </tr>
                                    </tbody>
                                </ItemTemplate>
                                <FooterTemplate>
                                    <tr>
                                        <td colspan="13" style="text-align: center;">
                                            <label id="lblEmpty" style='display: <%# rptGoods.Items.Count==0?"block":"none"%>;
                                                color: Red;'>
                                                没有找到任何记录</label>
                                        </td>
                                    </tr>
                                </FooterTemplate>
                            </asp:Repeater>
                        </table>
                      
                        <% Response.Write((new Gift.WebApp.PageListNo()).DisplayPage(total, pageSize, pageIndex)); %>
                    </form>
                </div>
            </td>

        </tr>
      
    </table>
</body>
</html>
















